package com.buba.controller;

import com.buba.service.LogoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Calendar;
import java.util.List;
import java.util.Map;

/**
 * 主页图表展示
 */
@RestController
@CrossOrigin(allowCredentials = "true"
        , originPatterns = "*")
public class LogoController {
    @Autowired
    private LogoService logoService;

    @RequestMapping("/selLoginLogChart")
    public Map<String, List<String>> selLoginLogChart() {
        Calendar calendar = Calendar.getInstance();
        int i = calendar.get(Calendar.YEAR);
        int year = i - 1;
        return logoService.selLoginLogChart(year + "-1-1");
    }

}
